<?php
if(!empty($_POST)){
	require('connect.php');
	$id = $_POST['id-edit'];
	$query = "SELECT ID,
		ReadTime as 'TimeRead',
		OpenGal as 'OpeningGallons',
		ProdNo as 'Product',
		Water as 'Water',
		Sales as 'Sales',
		GalDeliv as 'GrossDeliveries',
		CONVERT(VARCHAR(11), TrnDate, 111) as 'DateEntry',
		SystemOperating as 'Operating',
		SystemAlarm as 'Alarm',
		HosesOK as 'Hoses',
		NozzlesOK as 'Nozzles',
		DispensersOK as 'Dispensers',
		Comments as 'Commets',
		TankID as 'Tank'
		FROM EnvironmentalDaily
		where ID='$id'";
	$rows = sqlsrv_query($conn,$query);	
	$registro = null;
	while( $row = sqlsrv_fetch_array( $rows, SQLSRV_FETCH_ASSOC) ) {		
		echo json_encode($row);
	}
	

}else{
	echo "No hubo conexion";
}

sqlsrv_close($conn);